package com.woniuxy.rbac.web;

import com.woniuxy.rbac.service.CourseService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.GetMapping;

/**
 * @Auther: 老谭（<a href="http://www.woniuxy.com">蜗牛学苑</a>）
 */
@Controller
public class IndexController {

    @Autowired
    private CourseService courseService;

    @GetMapping
    public String index(Model model) {
        System.out.println(Thread.currentThread().getName());
        model.addAttribute("courses", courseService.list());
        model.addAttribute("name", "Jack");
        return "index";
    }
}
